<?php

/**
 * CelebrityPK filter form base class.
 *
 * @package    iEasy
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseCelebrityPKFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'celebrity1_id'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Celebrity'), 'add_empty' => true)),
      'celebrity2_id'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Celebrity2'), 'add_empty' => true)),
      'count1_i'        => new sfWidgetFormFilterInput(),
      'count2_i'        => new sfWidgetFormFilterInput(),
      'create_time'     => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'modify_time'     => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'is_alive_b'      => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'is_on_top_b'     => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'system_user_id'  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Systemuser'), 'add_empty' => true)),
      'count1_mask_i'   => new sfWidgetFormFilterInput(),
      'count2_mask_i'   => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'celebrity1_id'   => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Celebrity'), 'column' => 'celebrity_id')),
      'celebrity2_id'   => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Celebrity2'), 'column' => 'celebrity_id')),
      'count1_i'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'count2_i'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'create_time'     => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'modify_time'     => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'is_alive_b'      => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'is_on_top_b'     => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'system_user_id'  => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Systemuser'), 'column' => 'system_user_id')),
      'count1_mask_i'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'count2_mask_i'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('celebrity_pk_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'CelebrityPK';
  }

  public function getFields()
  {
    return array(
      'celebrity_pk_id' => 'Number',
      'celebrity1_id'   => 'ForeignKey',
      'celebrity2_id'   => 'ForeignKey',
      'count1_i'        => 'Number',
      'count2_i'        => 'Number',
      'create_time'     => 'Date',
      'modify_time'     => 'Date',
      'is_alive_b'      => 'Boolean',
      'is_on_top_b'     => 'Boolean',
      'system_user_id'  => 'ForeignKey',
      'count1_mask_i'   => 'Number',
      'count2_mask_i'   => 'Number',
    );
  }
}
